permutations with restriction

welcome to shbcf.ru